package y2016.test;

import java.io.*;
import java.util.regex.Matcher;

public class ReadBook {
    private StringBuffer sb;
    private BufferedReader br;
    String aLine = "";
    int next;
    private String[] strNu;

    public String getBookString(InputStream in, String charset) {
        sb = new StringBuffer();
//		 Pattern p=Pattern.compile("第.*?章");
        Matcher m = null;
        try {
            br = new BufferedReader(new InputStreamReader(in, charset));
            int len = 0;
            char[] ch = new char[512 * 50];
            while ((aLine = br.readLine()) != null) {
                sb.append(aLine);
            }

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                br.close();
                in.close();
            } catch (IOException e) {
                // TODO 自动生成的 catch 块
                e.printStackTrace();
            }
        }

        return sb.toString();

    }
}
